#include "edgeweight.h"
#include "graphscene.h"
edgeWeight::edgeWeight(QWidget *parent)
	: QDialog(parent)
{
	ui.setupUi(this);
	connect(ui.btnApply, SIGNAL(clicked()), this, SLOT(slot_btnApply()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(slot_btnCancel()));

}
edgeWeight::edgeWeight(QWidget *parent,int value)
	: QDialog(parent)
{
	ui.setupUi(this);
	connect(ui.btnApply, SIGNAL(clicked()), this, SLOT(slot_btnApply()));
	connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(slot_btnCancel()));
	ui.spinBox->setValue(value);
	ui.spinBox->setFocus(Qt::TabFocusReason);
	ui.spinBox->selectAll();
	weight=value;
}
edgeWeight::~edgeWeight()
{

}
void edgeWeight::slot_btnApply()
{
	weight=ui.spinBox->value();
	accept();
}
void edgeWeight::slot_btnCancel()
{
	reject();
}